SSDs achieve much of their performance by maintaining critical data structures in volatile memory, which allows quick access during runtime. Use of volatile memory during runtime presents a problem if power is suddenly lost as volatile memory depends upon being powered to store and maintain the data in memory. Upon the loss of power to a volatile memory, the data stored in volatile memory will be lost. Accordingly, it is necessary to save critical data structures stored in volatile memory to non-volatile memory before power to the SSD falls below a threshold required for SSD operation. To address this issue, many SSDs include capacitors with high capacitance (e.g., supercapacitors, tantalum capacitors, etc.) to provide backup power for a short period of time after the loss of power. The use of a backup power source in an SSD helps prevent data loss due to a power outage or power loss. This feature is generally referred to as power loss protection (PLP).
When a power outage or power loss occurs for a host device (e.g., a computer) with an SSD, the energy stored by the supercapacitor provides backup power for a short time for the SSD to complete pending commands, save critical data and shut down properly. Without this, the SSD may not initialize properly for a subsequent boot. For example, if the volatile memory loses critical data such as the logical to physical mapping table of data (i.e., a table storing the mapping between the logical address used by the host to refer to data and the address at which data is physically located within non-volatile memory), the SSD may be unusable or may require a long data structure rebuild that requires the SSD to scan the entire drive and determine where data is located.
When an SSD with PLP is unable to save critical data to non-volatile memory, there are two possible failures that could have occurred. Either the SSD firmware failed to complete the power loss procedure while operating on backup power (e.g., procedure failed to start) or the backup power source was unable to provide power long enough for the SSD firmware to complete the power loss procedure. To identify the cause of the failure that resulted in the loss of critical data from volatile memory, it is necessary to identify how long the SSD was able to properly operate after loss of power.
One technique for measuring the duration of SSD operation on backup power measures the time from detecting a loss of power to when the SSD firmware power loss procedure completes. This technique is not achievable. If the SSD firmware logs completion of the power loss procedure, the procedure will have completed successfully and the drive will restart normally. If the SSD firmware fails to complete the power loss procedure, the duration of SSD operation on backup power will not be logged.
Another problem with using the SSD to measure the duration of SSD operation is that the SSD itself is not capable of identifying the moment at which it can longer operate as the SSD will have stopped operating at that point in time. As such, it is not possible to log an unsuccessful power loss procedure.
Accordingly, there is an unmet demand for SSDs with PLP that can efficiently and reliably measure the duration of SSD operation on backup power to identify the cause of an improper SSD shut down.